 /* To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jhave.client;

import javax.swing.*;
import java.util.*;
import java.awt.*;
import org.jdom.Element;

/**
 *
 * @author bosmak40
 */
public class JVM_Default_Line_Element extends JHAVE_Abstract_JVM_Element implements JHAVE_Element{


    JVM_Default_Line_Element(Element child, JPanel returnedPanel, Vector components){
        super(child, returnedPanel, components);
    }

     /**
     * Adds JVM default line element to panel and to components vector.
     *
     */
    public void addElementToPanel(){
        JTextArea textArea = new JTextArea( child.getText(),25,80 );
        JTextField textField = new JTextField( "EMPTY", 80 );
        JButton loadFile = new JButton("Load File");
        JPanel panel = new JPanel(new BorderLayout(10,10));
        panel.add(textField, BorderLayout.PAGE_START);
        panel.add(loadFile, BorderLayout.PAGE_END);
        panel.add(textArea, BorderLayout.CENTER);
        JVMSimTextPane scrollPane =
            new JVMSimTextPane(panel, textField, textArea, loadFile); // A helper class
        this.components.add(scrollPane);
        this.returnedPanel.add(scrollPane);
    }

}